JSBool JS_ExecuteScript()

Description Compiles and executes a string of Javascript. If the script generates a return value, it is returned in *rval.
Arguments JSContext *cx, JSObject *obj, char *script, unsigned in sz, jsval *rval
cx is the opaque JSContext pointer that was passed to the JavaScript function.
obj is a pointer to the object in whose context the script executes. While the script is running, the this keyword is equal to this object. Usually this is the JSObject pointer that was passed to the JavaScript function.
script is a string containing JavaScript code. If the string size is not specified (see the sz argument), then the string must be null-terminated.
sz is the size of the string, in bytes. If sz is 0, then the length of the null-terminated string is computed automatically.
rval is a pointer to a single jsval. The function's return value is stored in *rval.
Returns A Boolean value indicating success (JS_TRUE) or failure (JS_FALSE).